//简化技能系统 角色初始拥有技能但是未激活
//

module.exports = {
    //
    skill:
    [
        {//skill0 隐身
            active : false,
            allCdTime : 30,
            effectValue:0,
            Init(efefectv,cd)
            {
                this.allCdTime = cd;
                this.effectValue = efefectv;
            },
            cdTime : 0,
            start(actor )//传入英雄对象
            {
                actor.addBuffer(0,this.effectValue);//技能效果
                this.cdTime = this.allCdTime;
            },
            update(dTime)
            {
                if(this.active == false)
                    return;
                this.cdTime -= dTime;
            },
            isNotCd()
            {
                return  this.cdTime <= 0;
            }

        },
          {//skill4 //碰撞体质 
            active : false,
            allCdTime : 40,
            effectValue: 0,
            cdTime : 0,
            Init(efefectv,cd)
            {
                this.allCdTime = cd;
                this.effectValue = efefectv;
            },
            start(actor )//传入英雄对象
            {
             //   actor.setScale(this.effectValue);//技能效果
             //   this.cdTime = this.allCdTime;
             //   this.active = false; //只有释放一次
            },
            update(dTime)
            {
                if(this.active == false)
                    return;
                this.cdTime -= dTime;
            },
            isNotCd()
            {
                return  this.cdTime <= 0;
            }

     },
           {//skill2 //增加闪避
            active : false,
            allCdTime : 40,
            effectValue: 0,
            cdTime : 0,
            Init(efefectv,cd)
            {
                this.allCdTime = cd;
                this.effectValue = efefectv;
            },
            start(actor )//传入英雄对象
            {
                actor.addBuffer(1,this.effectValue);//技能效果
                this.cdTime = this.allCdTime;
               // active = false;
            },
            update(dTime)
            {
                if(this.active == false)
                    return;
                this.cdTime -= dTime;
            },
            isNotCd()
            {
                return  this.cdTime <= 0;
            }

        },

         {//skill3 //抵挡伤害
            active : false,
            allCdTime : 40,
            effectValue: 0,
            cdTime : 0,
            Init(efefectv,cd)
            {
                this.allCdTime = cd;
                this.effectValue = efefectv;
            },
            start(actor )//传入英雄对象
            {
                actor.addBuffer(2,this.effectValue);//技能效果
                this.cdTime = this.allCdTime;
               // active = false;
            },
            update(dTime)
            {
                if(this.active == false)
                    return;
                this.cdTime -= dTime;
            },
            isNotCd()
            {
                return  this.cdTime <= 0;
            }

        },
         {//skill4 //碰撞体质 
                active : false,
                allCdTime : 40,
                effectValue: 0,
                cdTime : 0,
                Init(efefectv,cd)
                {
                    this.allCdTime = cd;
                    this.effectValue = efefectv;
                },
                start(actor )//传入英雄对象
                {
                    actor.setScale( actor,this.effectValue);//技能效果
                    this.cdTime = this.allCdTime;
                    this.active = false; //只有释放一次
                },
                update(dTime)
                {
                    if(this.active == false)
                        return;
                    this.cdTime -= dTime;
                },
                isNotCd()
                {
                    return  this.cdTime <= 0;
                }
    
         }
    ],
} 